package com.yimi.yinhepda.adapter.RecycleAdapter;

import android.content.Context;
import android.widget.ImageView;

import com.yimi.yinhepda.R;
import com.pda.ym.base.CommonRecycleAdapter;
import com.pda.ym.base.CommonViewHolder;
import com.yimi.yinhepda.entity.bean.TakePhotoEntity;

import java.util.List;

/**
 * @author 000432
 * @date 2018/6/5 0005
 */

public class SealSignTakePhotoAdapter extends CommonRecycleAdapter<TakePhotoEntity> {

    private CommonViewHolder.onItemCommonClickListener mCommonClickListener;
    private List<TakePhotoEntity> mDataList;

    public SealSignTakePhotoAdapter(Context context, List<TakePhotoEntity> dataList, CommonViewHolder.onItemCommonClickListener commonClickListener) {
        super(context, dataList, R.layout.take_photo_item);
        this.mCommonClickListener = commonClickListener;
        this.mDataList = dataList;
    }

    @Override
    public void bindData(CommonViewHolder holder, TakePhotoEntity data, int position) {
        ImageView ivTakePhoto = holder.getView(R.id.iv_takePhtot);
        ivTakePhoto.setImageBitmap(data.getBitmap());
        holder.setCommonClickListener(mCommonClickListener);
        if (position == mDataList.size() - 1) {
            ivTakePhoto.setImageResource(R.mipmap.ic_problem_camera);
        }
    }
}
